package com.example.cv.service.iml;

import com.example.cv.mapper.AdminMapper;
import com.example.cv.model.Admin;
import com.example.cv.model.Employer;
import com.example.cv.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周杰
 */
@Service
public class AdminServiceImpl implements AdminService {
    public AdminMapper adminMapper;

    @Autowired
    public void setAdminDao(AdminMapper adminMapper) {
        this.adminMapper = adminMapper;
    }

    @Override
    public Admin findAdmin(Admin admin) {
        return adminMapper.findAdmin(admin);
    }

    @Override
    public boolean deleteCandidateByCId(int c_id) {
        return adminMapper.deleteCandidateByCId(c_id);
    }

    @Override
    public boolean deleteEmployerByEId(int e_id) {
        return adminMapper.deleteEmployerByEId(e_id);
    }

    @Override
    public boolean updateAdmin(Admin admin) {
        return adminMapper.updateAdmin(admin);
    }

    @Override
    public Admin findAdminById(int a_id) {
        return adminMapper.findAdminById(a_id);
    }

    @Override
    public List<Employer> findEmployersByEName(String e_name) {
        return adminMapper.findEmployersByEName(e_name);
    }

    @Override
    public List<Employer> findAllEmployers() {
        return adminMapper.findAllEmployers();
    }

}
